package com.zegome.game.gomestory.main.scene.level;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.zegome.game.gomestory.main.A;
import com.zegome.game.gomestory.main.Center;
import com.zegome.game.gomestory.main.G;
import com.zegome.game.gomestory.main.helper.StageHelper;

public class LevelIndex 
{
	public ImageButton img;
	private Image[] star = new Image[3];
	private int index;
	
	public Actor getActor(Center ctr, TextureRegion ball,int starNum, int number)
	{
		float scale = 1.0f;
		this.index = number;
		img = ctr.stageHelper.createImageButton(ctr.g.mSkin, ball, ball, ball, 0, 0,(108*scale), (75*scale));
		Label numberLb = ctr.stageHelper.createLabel(ctr.g.mFont, "", Color.WHITE, 0, 0);
		if(index>=141){
			numberLb.setText("Noel"+(index-140));
		}
		else{
			numberLb.setText(this.index+"");
		}
		numberLb.setPosition(((108*scale) - numberLb.getTextBounds().width)/2, ((75*scale)-(numberLb.getTextBounds().height))/2);		
		//
		if(starNum > 0){
		star[0] = ctr.stageHelper.createImage(ctr.a.starRegion, (15), 0, (32*scale), (32*scale));
		if(starNum<1){
			star[0].setColor(0.3f, 0.3f, 0.3f, 1f);
		}
		star[1] = ctr.stageHelper.createImage(ctr.a.starRegion, (35*scale), 0, (32*scale), (32*scale));
		if(starNum<2){
			star[1].setColor(0.3f, 0.3f, 0.3f, 1f);
		}
		star[2] = ctr.stageHelper.createImage(ctr.a.starRegion, (55*scale), 0, (32*scale), (32*scale));
		if(starNum<3){
			star[2].setColor(0.3f, 0.3f, 0.3f, 1f);
		}
		img.addActor(star[0]);
		img.addActor(star[1]);
		img.addActor(star[2]);
		}
		img.addActor(numberLb);
		//
		return img;
	}
}
